Added support for passing client prop to Provider wrapper component#69
Added support for passing client prop to Provider wrapper component#69heysailor wants to merge 3 commits into
Conversation
|
Thanks for adding this @heysailor! When can we expect this to be merged? |
|
I think we're waiting for some major library structure decisions to be made, from other emails I've received. If you look at the merge changes, it's trivial to implement if you want it in the meantime. On Tue, Aug 23, 2016 at 5:34 AM +1000, "b_d" notifications@github.com wrote: Thanks for adding this @heysailor! When can we expect this to be merged? — |
|
It is easy to customize your own registerComponent( ) function. Another possibility is to use registerComponent and yet pass in a wrapped component. E.g, Navigation.registerScreen('screenId', () => <ApolloProvider ...> screen ). I haven't tried it but essentially, that's the only difference. |
|
That's true, and I do use a custom screen registration function (so I can centralise settings and a few other things). On Tue, Aug 23, 2016 at 9:02 PM +1000, "smooJitter" notifications@github.com wrote: It is easy to customize your own registerComponent( ) function. Another possibility is to use registerComponent and yet pass in a wrapped component. E.g, Navigation.registerScreen('screenId', () => screen ). I haven't tried it but essentially, that's the only difference. — |
|
Should be handled by #233 |
|
Please merge this... |
|
.. and add this to the online documentation ! |
Passing a client prop to the allows use of libraries such as Apollo Client, which depend on access to the root element.
More information: http://docs.apollostack.com/apollo-client/react.html
For example, the Apollo Client library has an enhanced ApolloProvider component to allow access to its client in the react tree. It depends on a client prop. This PR allows use as below:
app.js:
registerScreens.js:
Another viable alternative would a more generic way of passing props to the
<Provider />component. This could be as simple as taking a 4thproviderPropsargument where I've put 'client', which would then be spread on to<Provider />.